//
//  YBWIAPManager.h
//  AFNetworking
//
//  Created by ZXJ on 2018/12/24.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN


typedef NS_ENUM(NSInteger , YBWIAPPurchType){
    
    YBWIAPPurchSuccess = 0,       // 购买成功
    YBWIAPPurchFailed = 1,        // 购买失败
    YBWIAPPurchCancle = 2,        // 取消购买
    YBWIAPPurchVerFailed = 3,     // 订单校验失败
    YBWIAPPurchVerSuccess = 4,    // 订单校验成功
    YBWIAPPurchNotArrow = 5,      // 不允许内购
    
};

typedef void(^YBWIAPCompletionBolck)(BOOL success , NSString * message);

@interface YBWIAPManager : NSObject

+ (instancetype)shareIAPManager;

/**
 
 发起支付
 
 @param productID 产品ID
 @param orderCode 支付订单Code
 @param complcompletionete 支付完成回调
 */
- (void)startPurchWithProductID:(nonnull NSString *)productID orderCode:(nonnull NSString *)orderCode completion:(nonnull YBWIAPCompletionBolck)completion;


/**
 扫描本地支付凭证，是否有漏单，如果有漏单要进行服务器验证
 */
- (void)checkIAPReceiptIsValid;

/**
 订单服务器验证
 @param orderCode 订单Order code
 @param completion 验证回调
 */
- (void)checkYBWServerePayResultOrderCode:(NSString *)orderCode completion:(nonnull YBWIAPCompletionBolck)completion;



@end

NS_ASSUME_NONNULL_END
